package com.aaa.ssm.service.impl;

import com.aaa.ssm.dao.TmScenicDotDao;
import com.aaa.ssm.entity.TmScenicDot;
import com.aaa.ssm.service.TmScenicDotService;
import com.aaa.ssm.util.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @ fileName:TmScenicDotServiceImpl
 * @ description: 景点审核
 * @ createTime:2023/4/3 15:49
 * @ version:1.0.0
 */
@Service
public class TmScenicDotServiceImpl implements TmScenicDotService {
    //依赖注入
    @Resource
    private TmScenicDotDao tmScenicDotDao;

    @Override
    public PageInfo queryByParam(Page<TmScenicDot> page) {
        PageHelper.startPage(page.getPageNo(), page.getPageSize());
        PageInfo pageInfo = new PageInfo(tmScenicDotDao.queryByParam(page.getData()));
        return pageInfo;
    }

    @Override
    public int add(TmScenicDot tmScenicDot) {

        return tmScenicDotDao.add(tmScenicDot);
    }

    @Override
    public int update(TmScenicDot tmScenicDot) {
        return tmScenicDotDao.update(tmScenicDot);
    }

    @Override
    public int deleteById(String id) {
        return tmScenicDotDao.deleteById(id);
    }
}
